package DesignPattern.exer.absfactory;

import DesignPattern.exer.absfactory.bean.OfflineCourse;
import DesignPattern.exer.absfactory.bean.OnlineCourse;
import DesignPattern.exer.absfactory.factory.CourseFactory;
import DesignPattern.exer.absfactory.utils.XMLUtils;

public class Test {
    public static void main(String[] args) {
//        CourseFactory courseFactory = (CourseFactory) XMLUtils.getBean();
//        OfflineCourse offlineCourse = courseFactory.produceOfflineCourse();
//        OnlineCourse onlineCourse = courseFactory.produceOnlineCourse();
//        offlineCourse.teaching();
//        onlineCourse.teaching();
        CourseFactory javaCourse = XMLUtils.getBean("java");
        OfflineCourse javaOfflineCourse = javaCourse.produceOfflineCourse();
        OnlineCourse javaOnlineCourse = javaCourse.produceOnlineCourse();
        javaOfflineCourse.teaching();
        javaOnlineCourse.teaching();

        CourseFactory patternCourse = XMLUtils.getBean("pattern");
        OfflineCourse patternOfflineCourse = patternCourse.produceOfflineCourse();
        OnlineCourse patternOnlineCourse = patternCourse.produceOnlineCourse();
        patternOfflineCourse.teaching();
        patternOnlineCourse.teaching();

    }
}
